<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        div span {
            background: linear-gradient(90deg,red,blue) no-repeat right bottom;
            background-size: 0 3px;
            transition: background-size 1s;
            line-height: 2;
        }

        div:hover span {
            background-size: 100% 3px;
            background-position-x: left;
        }
    </style>
</head>
<body>
    <div>
        <span>再不好好学习，媳妇都没有了</span>

        <div>
        <span>啊啊啊</span>

        </div>
    </div>
</body>
</html>